package com.king.pattem.threadpool;

import java.util.concurrent.*;

/**
 * @author taomk
 * @version 1.0
 * @since 15-2-8 下午1:22
 */
public class MyThreadPoolExecutor extends ThreadPoolExecutor {

	public MyThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory, RejectedExecutionHandler handler) {
		super(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue, threadFactory, handler);
	}

	@Override
	protected void beforeExecute(Thread t, Runnable r) {
		System.out.println("beforeExecute MyThread Name : " + t.getName());
	}

	@Override
	protected void afterExecute(Runnable r, Throwable t) {
		System.out.println("afterExecute TID : " + Thread.currentThread().getId());
		System.out.println("afterExecute PoolSize : " + this.getPoolSize());
	}
}